<template>
  <div class="demo">
    <div class="map-container">
      <div class="map" :id="mapId"/>
    </div>
  </div>
</template>

<script>

  import {initMap} from '@/common/gaode-map';

  export default {
    name: 'GaodeDemo1',
    data () {
      return {
        mapId: `map${Number.parseInt(Math.random() * 999999, 10)}`,
        map: null
      };
    },
    mounted () {
      this.$nextTick(() => {
        const AMap = window.AMap;
        this.map = initMap(this.mapId);
      });
    }
  };
</script>

<style scoped>
</style>
